<?php
/**
 * <https://y.st./>
 * Copyright © 2017 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'Fixing the assembler',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<section id="dream">
	<h2>Dream journal</h2>
	<p>
		I dreamed Vivian and our mother were trying to decrypt Vivian&apos;s mobile for some reason.
		They game me a strange number.
		It was formatted like a $a[MAC] address, had all but the last five digits zeroed out, and they were convinced it was an encrypted key that, if decrypted, could itself be used to decrypt the device and access it&apos;s contents for whatever it was they wanted to do with them.
		The entire contents of the device were accessible from the device itself, but they wanted to do something else.
		I wasn&apos;t sure what, but I was confused.
		I also wasn&apos;t aware of where they&apos;d gotten the number until after I&apos;d managed to &quot;decrypt&quot; it.
	</p>
	<p>
		I was looking for a restroom, and I headed down a hallway I thought I knew.
		I recognised it as a hallway I wasn&apos;t supposed to be in, and that I&apos;d made mischief in in a dream (I don&apos;t think said dream actually happened), but there was a restroom I remembered before the point I should run into people.
		I didn&apos;t recognise the fact that if I was in a dream hallway, I must currently be dreaming though.
		The restroom was missing, and I started trying to search other places there for it.
		I began to hover around, still not recognising this was a dream, until I came to some people working with filing cabinets and one on a computer.
		Somehow, I recognised that the one on the computer could help me with the strange number, so I gave that to them without a word.
		Running it through their computer, they tried to decrypt it, but found it wasn&apos;t encrypted at all.
		They printed out a double-width paper with a report on the number, including that it was a $a[PIN] belonging to &quot;Vivian&quot;, no surname specified in the report.
		(My syster&apos;s name was hand-written, but the rest of the document was printed.)
		Furthermore, the report was marked with the name and seal of the Department of Homeland Security.
		I&apos;d unknowingly asked the government what the number was, and the government already had my sister&apos;s $a[PIN] in their records.
		Creepy.
	</p>
	<p>
		I tracked down Vivian, who I questioned as to where she and our mother had gotten the number from.
		She wouldn&apos;t say, but I got the feeling they&apos;d pulled from some sort of internal memory of the device, though I got the feeling this was a tiny, dedicated memory component built to hold only the $a[PIN].
		She was a bit defensive and asked why I wanted to know where the number came from, so I tried to show her the report; but it was fading!
		The part with the number itself and the part with my sister&apos;s name were gone, and the rest quickly followed.
		They&apos;d used special disappearing ink for secrecy!
		So why give me a printed copy of the report at all?
	</p>
	<p>
		Later, I was over at my parents&apos; house (I guess they were still together in the dream), and my father brought home a couple dogs.
		But one of them was a monster; it had bizarre skin texture and colour, and I recognised it (from another dream I don&apos;t think I&apos;ve ever actually had) as being a creature that reproduces by infecting other creatures.
		I tried to get my father to leave that one outside, but it was too late.
		In my past &quot;dream&quot;, we&apos;d had a particularly difficult time trying to get rid of the monsters, who are dangerous to all animals, including humans.
		To complicate matters, the carpet in the &quot;dream&quot; had had fleas; the fleas bit the dog monster, got infected, became flea monsters, and grew to very large sizes (about the size of a human head).
		The danger of these monsters isn&apos;t their size though, but their infectious nature.
		No mater what form the creatures end up taking (which is always based on the body that was infected to create them), they attack and infect those around them.
		The original creature&apos;s mind is lost; your body might not technically die, but your mind very much does.
		I tried to plan what to do, and the seemingly-uninfected dog came up to me.
		It opened its mouth though, and a bunch of tentacles protruded.
		It was infected after all, though it hadn&apos;t had time for its outer body to change yet, and it was about to attack!
		It latched onto me, and I woke up before I was able to get it off me.
	</p>
</section>
<section id="university">
	<h2>University drudgery</h2>
	<p>
		My discussion post for the day:
	</p>
	<blockquote>
		<p>
			It&apos;s worth noting that the assembler doesn&apos;t build the entire symbol table in the first pass.
			It only collects and records the labels, adding them to the symbol table.
			The rest of the symbol table is built in the second pass by adding the variables, like you said.
			I thought the entire symbol table could be built up in the first pass, but as I was trying to figure out how to do it to build my own assembler, I found this wasn&apos;t a realistic option.
		</p>
	</blockquote>
	<p>
		I&apos;m starting to enjoy my coursework again, despite the censorship.
		I&apos;m not enjoying all of it, but I am enjoying the parts that involve programming.
		Part of this is no doubt that time has past and I&apos;m starting to accept my new reality more, but I honestly believe part of it is due to my rotten teeth being gone.
		The infection isn&apos;t souring my mood so much, and I think that&apos;s giving me a happier outlook on even my school&apos;s noxious policies.
	</p>
</section>
<section id="include.d">
	<h2>include.d version 0.0.1.8</h2>
	<p>
		Due to the rushed release, version 0.0.1.7 has a bug that prevents Hack assembly code with symbols in it from being assembled.
		I&apos;ve now released a new version to fix that, and additionally have moved most of the assembler into include.d as well.
		Now only a small wrapper script, such as the following, is needed to run the assembler:
	</p>
	<blockquote>
<pre><code>&lt;?php declare(strict_types=1);
/**
 * Copyright © 2017 Alex Yst &lt;mailto:copyright@y.st&gt;
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see &lt;http://www.gnu.org./licenses/&gt;.
**/

// Causes all errors to be terminal
require &apos;st/y/function/error_handler.php&apos;;
set_error_handler(&apos;\\\\st\\\\y\\\\error_handler&apos;);
// Sets the script up to used the classes from include.d
spl_autoload_register();
// Pulls in the function file
require &apos;st/y/function/hack_assemble.php&apos;;

// This is where all the magic happens.
echo \\st\\y\\hack_asseble(file_get_contents(\$argv[1]));</code></pre>
	</blockquote>
</section>
<section id="docmod">
	<h2>Document modifications</h2>
	<p>
		On <a href="/en/weblog/2018/01-January/16.xhtml#Vivian">2018-01-16</a>, my sister, Vivian, requested that I replace all instances of her legal name in my journal with the name &quot;Vivian&quot;.
		She also asked that the name of the organisation she works for be redacted.
		This page was modified to fulfil that request.
	</p>
</section>
END
);
